package org.dftproject.patml.data;

import org.dftproject.genesis.core.persistence.IPersistable;
import org.w3c.dom.Document;

public abstract class PatmlSite implements IPersistable {
	
	private final String url;
	
	public PatmlSite(String url) {
		this.url = url;
	}
	
	public String getUrl() {
		return url;
	}

	public abstract String getPersonUrl(String id);

	public abstract Document getPersonData(String id);

	public abstract String getPersonId(String url);

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final PatmlSite other = (PatmlSite) obj;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}

	public abstract String getType();

}
